<?php
class Forum_modul  extends CI_Model {

	public function __construct() {
		// Call the Model constructor
		parent::__construct();

	}

	public function posting($start = 0, $finish = 10) {
		// запрос списка новостей
		$time = false;

		$DB2 = $this -> load -> database('forum', TRUE, TRUE);

		$select = "SELECT * FROM thread  
			where `thread`.`forumid` not in  
			(12, 22, 9, 18, 21, 13, 24, 23,22,26,13,27,25,18,8) 
			ORDER BY lastpost DESC limit {$start}, {$finish}";
		$q = $DB2 -> query($select);
		if ($q -> num_rows() > 0) {
			foreach ($q -> result() as $row) {
				$time[] = array('dateline' => date("d.m.y, H:i", $row -> dateline), 
				'threadid' => $row -> threadid, 'title' => $row -> title, );
			}
		}
		return $time;
	}

}
 